<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {

        Schema::create('orders', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('order_number');
            $table->decimal('pay_money',8,2);
            $table->timestamp('pay_at')->nullable()->comment('支付时间');
            $table->decimal('order_money',8,2);
            $table->integer('user_coupon_id')->nullable()->comment('用户优惠券id');
            $table->integer('coupon_id')->nullable()->comment('优惠卷id');
            $table->decimal('coupon_money',8,2)->nullable()->comment('优惠金额');
            $table->decimal('all_coupon_money',8,2)->nullable()->comment('总优惠金额');
            $table->timestamps();
            $table->softDeletes();
        });

    }

    /**

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('orders');
    }
}
